package com.syezon.wifikey.pwd;


import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import com.syezon.wifikey.base.BaseFragment;
import com.syezon.wifikey.R;
import com.syezon.wifikey.pwd.adapter.PwdAdapter;

import butterknife.BindView;

public class PwdFragment extends BaseFragment {

    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    @BindView(R.id.tab_layout)
    TabLayout mTabLayout;
    @BindView(R.id.vp_container)
    ViewPager mVpContainer;

    private String mParam1;
    private String mParam2;


    public PwdFragment() {
    }


    public static PwdFragment newInstance() {
        PwdFragment fragment = new PwdFragment();
        return fragment;
    }


    public static PwdFragment newInstance(String param1, String param2) {
        PwdFragment fragment = new PwdFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    @Override
    protected void initViewsAndEvents() {
        PwdAdapter pwdAdapter = new PwdAdapter(getChildFragmentManager());
        mVpContainer.setAdapter(pwdAdapter);
        mTabLayout.setupWithViewPager(mVpContainer);
    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.fragment_pwd;
    }

}
